<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Example13</title>
  <style>
    .target {
      width: 200px;
      height: 200px;
      border: 1px solid black;
      font-size: 30px;
      text-align: center;
      line-height: 200px;
    }
  </style>
</head>
<body>
  <div class="box target c" >hello！</div>
  <script>
    // 获取div元素
    var box = document.querySelector('.box');
    // 为获取到的div元素设置className
    box.className = 'target';
  </script>
</body>
<html>